﻿using MassTransit;

namespace HuaweiCloud.Dotnet.Samples.ESports.Main.Consumers
{
    public class RankInfoConsumerDefinition : ConsumerDefinition<RankInfoConsumer>
    {
        public RankInfoConsumerDefinition()
        {
            EndpointName = "RankInfoMain";
        }

        protected override void ConfigureConsumer(IReceiveEndpointConfigurator endpointConfigurator, 
            IConsumerConfigurator<RankInfoConsumer> consumerConfigurator)
        {
            endpointConfigurator.UseDelayedRedelivery(r => r.Intervals(TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(15), TimeSpan.FromMinutes(30)));
            endpointConfigurator.UseMessageRetry(r => r.Immediate(5));
        }
    }
}
